package com.lianzhihui.minitiktok.ui.main.two

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.echofeng.common.ui.base.BaseFragment
import com.lianzhihui.minitiktok.adapter.hot.HotTwoPayNiceAdapter
import com.lianzhihui.minitiktok.adapter.hot.HotTwoTopAdapter
import com.lianzhihui.onlyleague.R
import kotlinx.android.synthetic.main.fragment_hot_two.*

/**
 * A simple [Fragment] subclass.
 * Use the [HotTwoFragment.newInstance] factory method to
 * create an instance of this fragment.
 */
class HotTwoFragment : BaseFragment() {

    private lateinit var adapterTop: HotTwoTopAdapter
    private lateinit var adapterNice: HotTwoPayNiceAdapter

    override fun getLayoutId(): Int {
        return R.layout.fragment_hot_two
    }

    override fun initView() {
        adapterTop = HotTwoTopAdapter(ArrayList())
        adapterNice = HotTwoPayNiceAdapter(ArrayList())
        val gridLayoutManager = GridLayoutManager(context,3)
        mRecyclerView1.setLayoutManager(gridLayoutManager)
        mRecyclerView1.setAdapter(adapterTop)
        val linearLayoutManager = LinearLayoutManager(context)
        linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
        mRecyclerView2.setLayoutManager(linearLayoutManager)
        mRecyclerView2.setAdapter(adapterNice)
    }

    override fun initData() {
    }
    override fun onFragmentVisible() {
        super.onFragmentVisible()
        if (!loadFinish){
            loadFinish = true;
        }
    }
}